package com.byx.chatclient.contract.home;

import com.byx.chatclient.entity.MessagePo;
import com.byx.chatclient.entity.message.Message;
import com.byx.chatclient.entity.message.MsgBody;
import com.byx.chatclient.im.AbstractMessageSender;
import com.byx.chatclient.view.IBaseView;

import java.util.List;

/**
 * ChatTaskContract
 *
 * @author Superb
 * @date 2021/3/27 21:58
 */
public interface ChatTaskContract {
    /**
     * Model层
     */
    interface Model{
        /**
         * 保存聊天信息
         */
        void saveChatMessage(MessagePo userChat);

        /**
         * 根据好友id查询与其聊天的记录
         * @param userId 当前用户id
         * @param friendId 好友id
         * @return 聊天记录
         */
        List<MessagePo> getChatMessage(String userId, String friendId);

        /**
         * 根据群号查询所有该群的聊天记录
         * @param groupId 群id
         * @return 聊天记录
         */
        List<MessagePo> getGroupChatMsg(String groupId);
    }

    /**
     * view层
     */
    interface View extends IBaseView {
        void updateMsg(Message message);
    }

    interface Presenter {
        List<MessagePo> getSingleChatMsg(String userId, String friendId);
        List<MessagePo> getGroupChatMsg(String groupId);
        void saveChatMsg(MessagePo messagePo);

        void sendTextMessage(AbstractMessageSender.TextMessageParam messageParam);
        void sendFileMessage(AbstractMessageSender.FileMessageParam messageParam, AbstractMessageSender.OnUploadListener onUploadListener);
    }
    
}
